package com.liam.design.observer.obs;

import com.liam.design.observer.sub.Subject;
import com.liam.design.observer.sub.WeatherSubject;
import lombok.Data;

@Data
public class WeatherObserver implements Observer {


    private String name;


    /**
     * 获取目标类的数据，同步观察者
     * @param subject
     */
    public void update(Subject subject) {
        System.out.println( name + ":" + ((WeatherSubject)subject).getContent());
    }
}
